﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UCDanhMucTaiLieu.ascx.cs" Inherits="AIC_CD.UCDanhMucTaiLieu" %>
<style type="text/css">
    .style1
    {
        width: 100px;
        height: 28px;
    }
    .style2
    {
        height: 28px;
    }
</style>
<div class="FormTitle" runat="server">
    <p class="TextTitle">
        <label id="lblFormName" runat="server" class="lblFormName">
            </label>
        <asp:ImageButton CssClass="btnExit" ID="ImageButton1" runat="server" ImageUrl="Images/exit.png"
            Height="24px" OnClick="ImageButton1_Click" />
    </p>
</div>
<div class="FormMain">
    <div class="Form Search">
        <asp:RadioButton ID="radTaiLieuID1_DM" runat="server" GroupName="radTL" 
            AutoPostBack="True" oncheckedchanged="radTaiLieuID_DM_CheckedChanged"  />
        <asp:RadioButton ID="radTaiLieuID2_DM" runat="server" GroupName="radTL" 
            AutoPostBack="True" oncheckedchanged="radTaiLieuID_DM_CheckedChanged" />
        <asp:RadioButton ID="radTaiLieuID3_DM" runat="server" GroupName="radTL" 
            AutoPostBack="True" oncheckedchanged="radTaiLieuID_DM_CheckedChanged" />
        <asp:RadioButton ID="radTaiLieuID4_DM" runat="server" GroupName="radTL" 
            AutoPostBack="True" oncheckedchanged="radTaiLieuID_DM_CheckedChanged" />
        <asp:RadioButton ID="radTaiLieuID5_DM" runat="server" GroupName="radTL" 
            AutoPostBack="True" oncheckedchanged="radTaiLieuID_DM_CheckedChanged" />
        <asp:RadioButton ID="radTaiLieuID6_DM" runat="server" GroupName="radTL" 
            AutoPostBack="True" oncheckedchanged="radTaiLieuID_DM_CheckedChanged" />
        </div>
    <div class="Form Update" runat="server" id="formUpdate">
        <table border="1px" class="ListForm">
            <tr>
                <td class="style1">
                    Mã danh mục
                </td>
                <td class="style2">
                    <asp:TextBox ID="txtMaDanhMuc" runat="server" Enabled="false" CssClass="InputText"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Tên danh mục
                </td>
                <td>
                    <asp:TextBox ID="txtTenDanhMuc" runat="server" CssClass="InputText"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <asp:Button ID="btnLuu" runat="server" Text="Lưu lại" CssClass="cmdBtn" OnClick="btnLuu_Click" />
                    <asp:Button ID="btnHuy" runat="server" Text="Hủy" CssClass="cmdBtn" OnClick="btnHuy_Click" />
                </td>
            </tr>
        </table>
    </div>
    <div class="Form View">
        <asp:Button ID="btnThem" runat="server" Text="Thêm mới" CssClass="cmdBtn" OnClick="btnThem_Click" />
        <asp:GridView ID="grdDanhMuc" runat="server" AutoGenerateColumns="False" CssClass="ListTable"
            DataKeyNames="ID" OnRowCommand="grdDanhMuc_RowCommand">
            <Columns>
                <asp:TemplateField HeaderText="STT">
                    <ItemTemplate>
                        <asp:Label ID="lblIDDM" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Mã Danh Mục">
                    <ItemTemplate>
                        <asp:Label ID="lblMaDM" runat="server" Text='<%# Eval("MaDM") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Tên danh mục">
                    <ItemTemplate>
                        <asp:Label ID="lblTenDM" runat="server" Text='<%# Eval("TenDM") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Ngày tạo">
                    <ItemTemplate>
                        <asp:Label ID="lblNgayTao" runat="server" Text='<%# Eval("CreateDate") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Ngày cập nhật">
                    <ItemTemplate>
                        <asp:Label ID="lblNgayCapNhat" runat="server" Text='<%# Eval("UpdateDate") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Người cập nhật cuối">
                    <ItemTemplate>
                        <asp:Label ID="kbkNguoiCapNhat" runat="server" Text='<%# Eval("HoTen") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Sửa">
                    <ItemTemplate>
                        <asp:ImageButton ID="lbtEdit" runat="server" ImageUrl="images/edit.gif" CommandName="<%# AIC_CD.MyConst.Action.Update %>" CommandArgument='<%# Eval("ID") %>'></asp:ImageButton>
                    </ItemTemplate>
                    <ItemStyle Width="10px" HorizontalAlign="Center" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Xóa">
                    <ItemTemplate>
                        <asp:ImageButton ID="lbtDelete" runat="server" ImageUrl="images/delete.png" CommandName="<%# AIC_CD.MyConst.Action.Delete %>" OnClientClick="return confirm('Bạn có chắc là muốn xóa bản ghi này không ?')" CommandArgument='<%# Eval("ID") %>'></asp:ImageButton>
                    </ItemTemplate>
                    <ItemStyle Width="10px" HorizontalAlign="Center" />
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
</div>
